pkgname=plasma-workspace
pkgver=5.10.4
pkgrel=0
pkgdesc='KDE Plasma Workspace'
arch="all"
url='https://www.kde.org/workspaces/plasmadesktop/'
license="LGPL"
depends="kjsembed knotifyconfig libxdamage qt5-qttools xrdb xsetroot
		 kactivitymanagerd xprop kwin kdelibs4support kxmlgui
		 kdesu iso-codes qt5-qtwayland"
makedepends="extra-cmake-modules kdoctools-dev gpsd krunner-dev kdesignerplugin kdesignerplugin-dev
			 kxmlrpcclient-dev kdelibs4support-dev plasma-framework-dev knotifyconfig-dev
			 libxtst-dev kcmutils-dev kdesu-dev kwallet-dev ksysguard kwin-dev kguiaddons-dev
			 qt5-qtwayland kjsembed-dev knewstuff-dev libxrender-dev qt5-x11extras-dev
			 kwallet-dev attica-qt5-dev kitemmodels-dev kscreenlocker-dev libksysguard-dev
			 xcb-util-image-dev qt5-qtscript-dev karchive-dev kcrash-dev kpackage-dev
			 kdeclarative-dev kpty-dev kjs-dev ktextwidgets-dev sonnet-dev kauth-dev
			 kconfigwidgets-dev ki18n-dev kcodecs-dev kwidgetsaddons-dev kservice-dev
			 kxmlgui-dev kwindowsystem-dev kcoreaddons-dev kconfig-dev kemoticons-dev
			 kiconthemes-dev kinit-dev knotifications-dev kio-dev kbookmarks-dev kparts-dev
			 kcompletion-dev kitemviews-dev kjobwidgets-dev solid-dev kunitconversion-dev
			 kdbusaddons-dev kidletime-dev kglobalaccel-dev phonon-dev kwayland-dev kactivities-dev"
source="https://download.kde.org/stable/plasma/${pkgver}/${pkgname}-${pkgver}.tar.xz
		kde.pam"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"

prepare() {
	mkdir -p $srcdir/build
}

build() {
	cd $srcdir/build

	cmake $srcdir/$pkgname-$pkgver \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE=Release \
		-DKDE_INSTALL_LIBDIR=lib \
		-DKDE_INSTALL_LIBEXECDIR=lib \
		-DBUILD_TESTING=OFF
	make
}

package() {
	cd $srcdir/build
	make DESTDIR="$pkgdir" install

	install -Dm644 "$srcdir"/kde.pam "$pkgdir"/etc/pam.d/kde

	install -Dm644 plasmawayland.desktop "$pkgdir"/usr/share/wayland-sessions/plasmawayland.desktop
}
sha512sums="4bfcb18f73c4df0b4342e00b94ca375cc0ec1968e0f30ca8e14366dae5723ba9491fd073fc4408a9ae64c2efa52e72efd7e474e15b0cc4c65e1d42f1fe57170a  plasma-workspace-5.10.4.tar.xz
39c114084b224131d80a77742865c448b54ac1877426ec5591e58f142bbe77fe85d1717c82fe7c8d09b1aa77f7833664e406fbae04254b4e974f09a32486fa31  kde.pam"
